﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HotelManagement._01.FORM;
using CSDL_QuanLyBanHang._01.FORM;
using HotelManagement._02.BUS;
using HotelManagement._04.OBJECT;
using System.Diagnostics;

namespace HotelManagement
{
    public partial class F00_Main : Form
    {
        public F00_Main()
        {
            InitializeComponent();
            if (AssetsGS.instance.RoleUser == "User") 
            {
                timeWorkingManagementToolStripMenuItem.Enabled = false;
                userManagementToolStripMenuItem.Enabled = false;
                reportToolStripMenuItem.Enabled = false;
            }
        }
        private void AddWorkingTime()
        {
            //Quản lý thời gian đăng nhập và đăng xuất
            TimeBUS m_TimeBUS = new TimeBUS();
            Time m_Time = new Time();
            m_Time.LoginTime = AssetsGS.instance.LoginTime;
            m_Time.UserID = AssetsGS.instance.UserId;
            m_Time.LogoutTime = DateTime.Now;
            try
            {
                m_TimeBUS.AddTime(m_Time);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
        private void ServiceManagementToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            F41_ServiceManagement v_F41_ServiceManagement = new F41_ServiceManagement();
            v_F41_ServiceManagement.ShowDialog();
        }

        private void CheckInToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F26_CheckIn v_F26_CheckIn = new F26_CheckIn();
            v_F26_CheckIn.ShowDialog();

        }

        private void CheckOutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F25_CheckOut v_F25_CheckOut = new F25_CheckOut();
            v_F25_CheckOut.ShowDialog();
        }

        private void CheckInInfoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F24_CheckInInfo v_F24_CheckInInfo = new F24_CheckInInfo();
            v_F24_CheckInInfo.ShowDialog();
        }

        private void RoomInfoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F31_Room v_F31_Room = new F31_Room();
            v_F31_Room.ShowDialog();
        }


        private void UserManagementToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F11_UserManagement v_F11_UserManagement = new F11_UserManagement();
            v_F11_UserManagement.ShowDialog();
        }


        private void RoomTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F32_RoomType v_F32_RoomType = new F32_RoomType();
            v_F32_RoomType.ShowDialog();
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddWorkingTime();
            Application.Exit();
        }

        private void CustomerService_Click(object sender, EventArgs e)
        {
            F42_CustomerService v_F42_CustomerService = new F42_CustomerService();
            v_F42_CustomerService.ShowDialog();
        }

        private void Logout_Click(object sender, EventArgs e)
        {
            this.Hide();
            AddWorkingTime();
            F01_Login v_F01_Login = new F01_Login();
            v_F01_Login.ShowDialog();
        }

        private void reservationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F21_Reservation v_F21_Reservation = new F21_Reservation();
            v_F21_Reservation.ShowDialog();
        }

        private void report_Click(object sender, EventArgs e)
        {
            F02_Report v_F02_Report = new F02_Report();
            v_F02_Report.ShowDialog();
        }


        private void CustomerInfo_Click(object sender, EventArgs e)
        {
            F22_CustomerInfo v_F22_CustomerInfo = new F22_CustomerInfo();
            v_F22_CustomerInfo.ShowDialog();
        }


        private void thôngTinThanhToánToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F51_PaymentInformation v_F51_PaymentInformation = new F51_PaymentInformation();
            v_F51_PaymentInformation.ShowDialog();
        }

        private void thanhToánToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            F52_Payment v_F52_Payment = new F52_Payment();
            v_F52_Payment.ShowDialog();
        }

        private void Time_Click(object sender, EventArgs e)
        {
            F13_WorkingTimeManagement v_F13_WorkingTimeManagement = new F13_WorkingTimeManagement();
            v_F13_WorkingTimeManagement.ShowDialog();
        }

        private void F00_Main_FormClosed(object sender, FormClosedEventArgs e)
        {
            AddWorkingTime();
            Application.Exit();
        }

        private void đổiMậtKhẩuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F12_ChangePassword v_F12_ChangePassword = new F12_ChangePassword();
            v_F12_ChangePassword.ShowDialog();
        }

        private void đổiHủyPhòngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F23_DestroyRevervation v_F23_DestroyRevervation = new F23_DestroyRevervation();
            v_F23_DestroyRevervation.ShowDialog();
        }

        private void chínhSáchGiáĐặtBiệtToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F62_SpecialPricing v_F62_SpecialPricing = new F62_SpecialPricing();
            v_F62_SpecialPricing.ShowDialog();

        }

        private void thôngTinKhácToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F61_OtherInfo v_F61_OtherInfo = new F61_OtherInfo();
            v_F61_OtherInfo.ShowDialog();

        }

        private void quyĐịnhKháchSạnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            F63_Regulation v_F63_Regulation = new F63_Regulation();
            v_F63_Regulation.ShowDialog();
        }

    }
}
